package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.system.ScenicOperationDynamicInfo;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.mapper.OperationInfoMapper;
import com.ruoyi.system.service.IScenicOperationDynamicInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.List;

/**
 * 运营动态信息。Service业务层处理
 *
 * @author zjw
 * @date 2023-09-12
 */
@Service
public class ScenicOperationDynamicInfoServiceImpl implements IScenicOperationDynamicInfoService {
    @Autowired
    private OperationInfoMapper operationInfoMapper;

    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm");

    /**
     * 查询运营动态信息。
     *
     * @param operationInfoId 运营动态信息。主键
     * @return 运营动态信息。
     */
    @Override
    public ScenicOperationDynamicInfo selectOperationInfoByOperationInfoId(Long operationInfoId) {
        return operationInfoMapper.selectOperationInfoByOperationInfoId(operationInfoId);
    }

    /**
     * 查询运营动态信息。列表
     *
     * @param scenicOperationDynamicInfo 运营动态信息。
     * @return 运营动态信息。
     */
    @Override
    public List<ScenicOperationDynamicInfo> selectOperationInfoList(ScenicOperationDynamicInfo scenicOperationDynamicInfo) {
        return operationInfoMapper.selectOperationInfoList(scenicOperationDynamicInfo);
    }

    /**
     * 新增运营动态信息。
     *
     * @param scenicOperationDynamicInfo 运营动态信息。
     * @return 结果
     */
    @Override
    public int insertOperationInfo(ScenicOperationDynamicInfo scenicOperationDynamicInfo) {
        scenicOperationDynamicInfo.setCreateTime(DateUtils.getNowDate());
        return operationInfoMapper.insertOperationInfo(scenicOperationDynamicInfo);
    }

    /**
     * 修改运营动态信息。
     *
     * @param scenicOperationDynamicInfo 运营动态信息。
     * @return 结果
     */
    @Override
    public int updateOperationInfo(ScenicOperationDynamicInfo scenicOperationDynamicInfo) {
        return operationInfoMapper.updateOperationInfo(scenicOperationDynamicInfo);
    }

    /**
     * 批量删除运营动态信息。
     *
     * @param operationInfoIds 需要删除的运营动态信息。主键
     * @return 结果
     */
    @Override
    public int deleteOperationInfoByOperationInfoIds(Long[] operationInfoIds) {
        return operationInfoMapper.deleteOperationInfoByOperationInfoIds(operationInfoIds);
    }

    /**
     * 删除运营动态信息。信息
     *
     * @param operationInfoId 运营动态信息。主键
     * @return 结果
     */
    @Override
    public int deleteOperationInfoByOperationInfoId(Long operationInfoId) {
        return operationInfoMapper.deleteOperationInfoByOperationInfoId(operationInfoId);
    }
}
